package bean;

import comm.nullcheck;

public class pagingBean {
	private String nowpage;
	private String datatotalcount;
	private String formname;
	private String pagecount;
	private String pagesize;
	
	private String startNum;
	private String endNum;
	
	nullcheck nullcheck = new nullcheck();
	
	public String getNowpage() {
		return nowpage;
	}
	public void setNowpage(String nowpage) {
		this.nowpage = nullcheck.setSkynulltoOne(nowpage);
	}
	public String getDatatotalcount() {
		return datatotalcount;
	}
	public void setDatatotalcount(String datatotalcount) {
		this.datatotalcount = nullcheck.setSkynulltoZero(datatotalcount);
		
		
		int size = Integer.parseInt(pagesize == null ? "20" : pagesize);
		int pn = Integer.parseInt(nowpage == null ? "1" : nowpage);
		
		int en = pn * size;
		int sn = en - size + 1;
		
		this.setStartNum(String.valueOf(sn));
		this.setEndNum(String.valueOf(en));		
	}
	public String getFormname() {
		return formname;
	}
	public void setFormname(String formname) {
		this.formname = nullcheck.setSkynulltoblank(formname);
	}
	public String getPagecount() {
		return pagecount;
	}
	public void setPagecount(String pagecount) {
		this.pagecount = nullcheck.setSkynulltoCount(pagecount);
	}
	public void setPagesize(String pagesize) {
		this.pagesize = nullcheck.setSkynulltoSize(pagesize);
	}
	public String getPagesize() {
		return pagesize;
	}
	public void setStartNum(String startNum) {
		this.startNum = startNum;
	}
	public String getStartNum() {
		return startNum;
	}
	public void setEndNum(String endNum) {
		this.endNum = endNum;
	}
	public String getEndNum() {
		return endNum;
	}
	
}
